package com.formiaomiao.demain.controller;

import com.formiaomiao.demain.model.FriendRemarksBean;
import com.formiaomiao.demain.service.FriendRemarksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class FriendRemarksController {

    @Autowired
    FriendRemarksService remarksService;

    /**
     * 修改好友备注
     * @param friendfrom
     * @param friendto
     * @param friendremarks
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/updateremarks")
    private Object UpdateRemarks(@RequestParam(name = "friendfrom", required = false) Integer friendfrom,
                                 @RequestParam(name = "friendto", required = false) Integer friendto,
                                 @RequestParam(name = "friendremarks", required = false) String friendremarks){
        FriendRemarksBean bean = new FriendRemarksBean();
        bean.setFriendfrom(friendfrom);
        bean.setFriendto(friendto);
        bean.setFriendremarks(friendremarks);
        return remarksService.UpdateRemarks(bean);
    }

}
